TEX = pages/title.tex pages/1.tex pages/2.tex pages/3.tex pages/4.tex pages/5.tex pages/6.tex pages/7.tex pages/8.tex pages/9.tex pages/10.tex pages/11.tex pages/12.tex
PDF = out/title.pdf out/1.pdf out/2.pdf out/3.pdf out/4.pdf out/5.pdf out/6.pdf out/7.pdf out/8.pdf out/9.pdf out/10.pdf out/11.pdf out/12.pdf out/all.pdf

all: $(PDF)

out/all.tex: $(TEX)
	runhaskell -i. gen.hs $(TEX) > $@

out/%.tex: pages/%.tex
	runhaskell -i. gen.hs $< > $@

out/%.pdf: out/%.tex
	pdflatex -output-directory=out $<

pages/%.tex: pages/%.hs
	runhaskell -i. $< > $@
